/**
 * Copyright (C) 2015-2018 IQIYI
 * All rights reserved.
 *
 * Author     : 王海斌
 * E-mail     : wanghaibin@qiyi.com
 * Version    :
 * Date       : Thu 26 Nov 2020 08:56:49 PM CST
 * Destription: 测试遮掩继承而来的名称
 */

#include <stdio.h>

class Base {
private:
    int x;

public:
    Base () {}
    virtual ~Base () {}
    virtual void mf1() {
        printf("base mf1\n");
    }
    virtual void mf1(int m){
        printf("base mf1_m %d\n", m);
    }
    virtual void mf2() {
        printf("base mf2\n");
    }

    void mf3() {
        printf("base mf3\n");
    }
    void mf3(double d) {
        printf("base mf3_d %f\n", d);
    }

    void qq() {
        printf("base qq\n");
    }
};

class Derived : public Base
{
public:
    using Base::mf1; // 不加这两句将编译不过
    using Base::mf3;
    Derived () {}
    virtual ~Derived () {}

    virtual void mf1() {
        printf("derived mf1\n");
    }
    void mf3() {
        printf("derived mf3\n");
    }
    void mf4() {
        mf2();
    }
private:
    /* data */
};

int main(int, char ** ) {

    Derived d;
    int x = 100;
    d.mf1();
    d.mf1(x);
    d.mf2();
    d.mf3();
    d.mf3(x);
    d.qq();
    return 0;
}
